﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System .Data .Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using System.Web.Mvc;
namespace VehicleManagement.Models
{

    /// <summary>
    /// 车辆维修类
    /// </summary>
    public class Fix
    {
        public int AddGasID { get; set; }
        public int CarID { get; set; }
        public int DriverID { get; set; }

        [DisplayName("维修日期")]
        [Required(ErrorMessage = "日期不能为空")]
        [DataType(DataType.DateTime)]
        public DateTime FixDate { get; set; }

        [DisplayName("车牌号码")]
        [Required(ErrorMessage = "车牌号不能为空")]
        [StringLength(100, ErrorMessage = "长度不能超过18位")]
        public virtual string CarNumber { get; set; }

        [DisplayName("司机姓名")]
        [Required(ErrorMessage = "姓名不能为空")]
        [StringLength(18, ErrorMessage = "长度不能超过18位")]
        public virtual string DriverName { get; set; }

        [DisplayName("票据编号")]
        [Required(ErrorMessage = "编号不能为空")]
        [StringLength(18, ErrorMessage = "长度不能超过18位")]
        [Remote("GetFIXInvoiceNo", "Fix", ErrorMessage = "该保单号已存在！")]
        public string InvoiceNo { get; set; }


        [DisplayName("下次保养时间")]
        [Required(ErrorMessage = "时间不能为空")]
        [DataType(DataType.DateTime)]
        public DateTime NextFix { get; set; }


        [DisplayName("下次保养里程")]
        [Required(ErrorMessage = "里程不能为空")]
        public decimal NextDis { get; set; }


        
        [DisplayName("有无审批")]
        [Required(ErrorMessage = "有无审批不能为空")]
        public Boolean Approval { get; set; }

        [DisplayName("维修项目")]
        [Required(ErrorMessage = "维修项目不能为空")]
        [StringLength(18, ErrorMessage = "长度不能超过18位")]
        public string FixName { get; set; }


        [DisplayName("单价")]
        [Required(ErrorMessage = "单价不能为空")]
        public decimal Price { get; set; }


        [DisplayName("数量")]
        [Required(ErrorMessage = "数量不能为空")]
        public decimal Num { get; set; }

        [DisplayName("维修总价")]
        [Required(ErrorMessage = "总价不能为空")]
        public decimal Cost { get; set; }

        [DisplayName("当时公里数目")]
        [Required(ErrorMessage = "公里数不能为空")]
        public decimal Distance { get; set; }


        [DisplayName("修理厂名称")]
        [Required(ErrorMessage = "名称不能为空")]
        [StringLength(18, ErrorMessage = "长度不能超过18位")]
        public string FixStaName { get; set; }


        [DisplayName("登记日期")]
        [Required(ErrorMessage = "登记日期不能为空")]
        [DataType(DataType.DateTime)]
        public DateTime RegisterDate { get; set; }


        [DisplayName("登记人")]
        [Required(ErrorMessage = "登记人不能为空")]
        [StringLength(18, ErrorMessage = "长度不能超过18位")]
        public string RegisterPerson { get; set; }


        [DisplayName("说明")]
        public string Remark { get; set; }

        //CompanyName char(32),
        [DisplayName("公司名称")]
        public string CompanyName { get; set; }
    }
}
